from django.conf.urls import url
from . import views
urlpatterns = [
    # users:register用户注册
    url(r'^register/$',views.RegisterView.as_view(),name='register'),
    # 注册用户名个数
    url(r'^usernames/(?P<username>[a-zA-Z0-9_]{5,20})/$',views.RegisterUsernameCountView.as_view(),name='usernamecount'),
    # 手机号
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})$', views.MobileNumberCountView.as_view(),name='mobile'),
    # 登陆
    url(r'^login/$',views.LoginView.as_view(),name='login'),
    # 退出
    url(r'^logout/$',views.LogoutView.as_view(),name='logout'),
    # 验证是否登陆
    url(r'^info/$',views.UserInfoView.as_view(),name='info'),
    # email
    url(r'^emails/$',views.EmailView.as_view(),name='email'),
    # 邮件激活
    url(r'^emails/verification/$', views.EmailVerifyView.as_view(), name='emailverify'),
    # 地址
    url(r'^address/$',views.AddressView.as_view(),name='address'),
    # 新增地址
    url(r'^addresses/create/$',views.CreateAddressView.as_view(),name='createaddress'),
    # 修改/删除地址
    url(r'^addresses/(?P<address_id>\d+)/$',views.UpdateDestroyAddressView.as_view(),name='updatedestroyaddress'),
    # 设置默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$',views.DefaultAddressView.as_view(),name='defaultaddress'),
    # 修改地址标题
    url(r'^addresses/(?P<address_id>\d+)/title/$',views.UpdateTitleAddressView.as_view(),name='updatetitleaddress'),
    # 修改密码
    url(r'^changepassword/$',views.ChangePasswordView.as_view(),name='changepassword'),
    # 保存历史记录
    url(r'^browse_histories/$',views.HistoryView.as_view(),name='history'),





]